package com.zjy.pgcms.dto.user;

import com.zjy.pgcms.dto.BasicDTO;
import com.zjy.pgcms.util.ValidationUtil;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 音音音
 */
@Data
public class UserUpdateDTO implements BasicDTO {
    private MultipartFile file;
    private String name;
    private Byte gender;
    private String phone;
    private String email;

    @Override
    public Boolean paramsValidation() {
        if (!ValidationUtil.nameValidation(name)){
            return true;
        }
        if (!ValidationUtil.genderValidation(gender)){
            return true;
        }
        if (!ValidationUtil.phoneValidation(phone)){
            return true;
        }
        if (!ValidationUtil.emailValidation(email)){
            return true;
        }
        return false;
    }
}
